use std::collections::HashMap;

use crate::core::manifest::*;

use crate::extensions::commands::plugin::CommandsPlugin;

pub fn create_commands_manifest() -> ExpansionManifest {
    ExpansionManifest {
        name: "commands".to_string(),
        description: "Provides command handling capabilities".to_string(),
        publisher: "System".to_string(),
        version: "1.0.0".to_string(),
        readme: None,
        dependencies: None,
        implementation: || Box::new(CommandsPlugin::new()),
        activation_events: vec![ActivationEvent::Simple("system.startup".to_string())], // Assuming it activates on startup
        deactivation_events: None,
        
        // This plugin defines the `commands` keyword
        contribution_keywords: Some(vec![ContributionKeywordDefinition {
            name: "commands".to_string(),
            support_contribution_point: Some(true),
            support_dynamics: Some(true),
            provide_context: Some(true),
            context_name: Some("commands".to_string()),
            disable_namespace_rule: Some(false),
        }]),

        // This plugin also defines a contribution point for other plugins to add commands
        contribution_points: Some({
            let mut points = HashMap::new();
            points.insert(
                "commands".to_string(),
                vec![ContributionPointDefinition {
                    name: "commands".to_string(),
                    description: Some("A point for other plugins to contribute commands".to_string()),
                    support_dynamics: Some(true),
                    is_replenish: None,
                    replenish_by: None,
                }],
            );
            points
        }),

        contributes: None,
        dynamic_contributes: None,
        dynamic_contribution_points: None,

        provide_context: Some(true),
        context_name: Some("commands".to_string()),
    }
}